<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: Alta Y
  Date: 2019/10/7
  Time: 0:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="css/font.css">
    <link rel="stylesheet" href="css/xadmin.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote">欢迎平台人员：
                        <span class="x-red">${user.username}
                        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
                        </a>
                        </span>
                        <div id="time"></div>

                    </blockquote>

                </div>
            </div>

        </div>

        <!--基本信息展示-->
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">数据统计</div>
                <div class="layui-card-body ">
                    <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>用户数</h3>
                                <p>
                                    <cite>${userCount}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>角色数</h3>
                                <p>
                                    <cite>${roleCount}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>公告数</h3>
                                <p>
                                    <cite>${infoCount}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>订单数</h3>
                                <p>
                                    <cite>${purchaseCount}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>待审核公告数</h3>
                                <p>
                                    <cite>${infoAudit}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>待审核订单数</h3>
                                <p>
                                    <cite>${purchaseAudit}</cite></p>
                            </a>
                        </li>

                    </ul>
                </div>
            </div>
        </div>

        <!-- 公告列表 -->
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">最新公告列表</div>
                <div class="layui-card-body ">
                    <table class="layui-table gonggaotable">
                        <colgroup>
                            <col width="150">
                            <col>
                            <col width="300">
                        </colgroup>
                        <thead>

                        <tr >
                            <th>id</th>
                            <th>标题</th>
                            <th>发布时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${lastest}" var="lastest">
                            <tr onclick="xadmin.open('公告详情','/annDetail?notify_id=${lastest.notify_id}',600,500)">
                                <td>${lastest.notify_id}</td>
                                <td>${lastest.title}</td>
                                <td><fmt:formatDate value="${lastest.create_date}" pattern="yyyy-MM-dd" /></td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- 数据统计 -->

        <style id="welcome_style"></style>

    </div>
</div>
</div>
<script type="text/javascript">
    function time() {
        var vWeek, vWeek_s, vDay;
        vWeek = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
        var date = new Date();
        year = date.getFullYear();
        month = date.getMonth() + 1;
        day = date.getDate();
        hours = date.getHours();
        minutes = date.getMinutes();
        seconds = date.getSeconds();
        vWeek_s = date.getDay();
        document.getElementById("time").innerHTML = year + "年" + month + "月" + day + "日" + "\t" + hours + ":" +
            minutes + ":" + seconds + "\t" + vWeek[vWeek_s];

    };
    setInterval("time()", 1000);
</script>
</body>

</html>
